#!/bin/bash
mkdir -p ~/k8s
# PROXY=192.168.50.235:10809
K8S_VERSION=$(curl --proxy $PROXY -L -s https://dl.k8s.io/release/stable.txt)
curl --proxy $PROXY -L -o ~/k8s/kubernetes-server-linux-amd64.tar.gz https://dl.k8s.io/$K8S_VERSION/kubernetes-server-linux-amd64.tar.gz

MASTER01=192.168.56.11
MASTER02=192.168.56.12
MASTER03=192.168.56.13
ssh vagrant@$MASTER02 "mkdir -p ~/k8s"
ssh vagrant@$MASTER03 "mkdir -p ~/k8s"
scp ~/k8s/* vagrant@$MASTER02:~/k8s
scp ~/k8s/* vagrant@$MASTER03:~/k8s

sudo tar Cxzvf /usr/local/bin ~/k8s/kubernetes-server-linux-amd64.tar.gz --strip-components=3 kubernetes/server/bin/kube{let,ctl,-apiserver,-controller-manager,-scheduler,-proxy}
kubelet --version
